package main

import (
	"ailearning-demo/app/demo"
	"ailearning-demo/app/register"
	"ailearning-demo/app/user"
	"ailearning-demo/dao"
	"log"
)

func main() {
	register.Include(demo.Register, user.Register)
	engine := register.Init()

	// 获取数据库连接
	err := dao.InitDB()
	if err != nil {
		log.Fatal("init database error: ", err.Error())
		return
	}

	err = engine.Run(":8080")

	if err != nil {
		log.Fatal("start server error:", err.Error())
	}
}
